#include <stdio.h>
#include <string.h>
#include "utils.h"


int ByteArr2Bitstr(int ba,int * bs){
    for (int i =0 ;i<8;++i)
        {
            int nTmp = (1 << i);
            bs[7-i] = (( ba & nTmp) == nTmp )? 1 : 0;
        }
}

int Bitstr2ByteArr(int * bs,int ba)
{
    int n = 0;
    for (int i = 0 ; i < 8;++i)
    {
        n += bs[7-i] * (1 << i);
    }
    *bs = n;
    return n;
}